# coding: utf-8
from typing import Any

from sqlalchemy import Column, Date, DateTime, Float, String, Text
from sqlalchemy.dialects.mysql import INTEGER
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata


class MemberInfo(Base):
    # __abstract__ = True
    __tablename__ = 'member_info'

    memberid = Column(INTEGER(11), primary_key=True, comment='成员编号')
    membername_CN = Column(String(255), comment='成员中文名')
    membername_EN = Column(String(255), comment='成员英文名')
    membername_ALIAS = Column(String(255), comment='成员别名')
    member_identity = Column(String(18), comment='成员身份ID')
    member_status = Column(INTEGER(11), comment='成员状态(判定结果)')
    member_gender = Column(INTEGER(11), comment='成员性别')
    member_birth = Column(Date, comment='成员出生日期')
    member_height = Column(Float, comment='成员身高')
    member_weight = Column(Float, comment='成员体重')
    member_marriage = Column(INTEGER(11), comment='成员婚姻状况')
    member_country = Column(String(1000), comment='成员国籍')
    member_party = Column(String(1000), comment='成员党派')
    member_religion = Column(String(1000), comment='成员信仰')
    member_position = Column(String(1000), comment='成员职位')
    member_education = Column(String(1000), comment='成员学历')
    member_phone = Column(String(1000), comment='成员电话')
    member_mail = Column(String(1000), comment='成员电子邮件')
    member_address = Column(String(1000), comment='成员地址')
    member_linkedin = Column(String(1000), comment='成员linkedin帐号')
    member_facebook = Column(String(1000), comment='成员facebook帐号')
    member_twitter = Column(String(1000), comment='成员twitter帐号')
    member_instagram = Column(String(1000), comment='成员instagram帐号')
    member_youtube = Column(String(1000), comment='成员youtube帐号')
    member_telegram = Column(String(1000), comment='成员telegram帐号')
    member_otherinfo = Column(Text, comment='成员其他信息')
    create_by = Column(String(64), comment='添加人')
    create_time = Column(DateTime, comment='添加时间')

    def __str__(self):
        return f"MyClass(memberid={self.memberid}, membername_CN='{self.membername_CN}', \
    membername_EN='{self.membername_EN}', membername_ALIAS='{self.membername_ALIAS}', \
    member_identity='{self.member_identity}', member_status={self.member_status}, \
    member_gender={self.member_gender}, member_birth='{self.member_birth}', \
    member_height={self.member_height}, member_weight={self.member_weight}, \
    member_marriage={self.member_marriage}, member_country='{self.member_country}', \
    member_party='{self.member_party}', member_religion='{self.member_religion}', \
    member_position='{self.member_position}', member_education='{self.member_education}', \
    member_phone='{self.member_phone}', member_mail='{self.member_mail}', \
    member_address='{self.member_address}', member_linkedin='{self.member_linkedin}', \
    member_facebook='{self.member_facebook}', member_twitter='{self.member_twitter}', \
    member_instagram='{self.member_instagram}', member_youtube='{self.member_youtube}', \
    member_telegram='{self.member_telegram}', member_otherinfo='{self.member_otherinfo}', \
    create_by='{self.create_by}', create_time='{self.create_time}')"

    def __init__(self, *args: Any, **kwargs):
        super().__init__(*args, **kwargs)
        self.__dict__.update(kwargs)
